home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / STRINGS / PACKAGE6 / LENGTH.DOC < prev    next >
Text File  |  1990-07-25  |  1KB  |  36 lines

  1. ----------------------------------------------------------------------------
  2. LengthOfString
  3. ----------------------------------------------------------------------------
  4.  
  5. declaration:      function LengthOfString (    AString:
  6.                                                   TypeString):  integer;
  7.  
  8. purpose:          Returns the number of characters in a string.
  9.  
  10. preconditions:    AString was originally initalized.
  11.  
  12. postconditions:   0 <= LengthOfString <= MaxStringLength
  13.  
  14. special cases:    none
  15.  
  16. example:          var
  17.                     Name:
  18.                       TypeString;
  19.                     LastKey:
  20.                       TypeKey;
  21.  
  22.                   begin
  23.                     .
  24.                     .
  25.                     .
  26.                     ReadLnString (Name, MaxStringLength, LastKey);
  27.                     write (output , 'Your name is ');
  28.                     write (output, LengthOfString (Name));
  29.                     writeln (output, 'characters long.')
  30.                     .
  31.                     .
  32.                     .
  33.                   end
  34.  
  35. ----------------------------------------------------------------------------
  36.